<%-- 
    Document   : PaginaDisciplina
    Created on : 03/12/2013, 22:13:54
    Author     : MONTENEGRO
--%>

<%@page import="br.edu.ifrn.Classes.Disciplina"%>
<%@page import="java.util.ArrayList"%>
<%@page import="br.edu.ifrn.Classes.Curso"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<jsp:useBean id="disciplinas" scope="session" type="java.util.List" beanName="disciplina"></jsp:useBean>
<jsp:useBean id="cursos" scope="session" type="java.util.List" beanName="curso"></jsp:useBean>
    <!DOCTYPE html>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <link rel="stylesheet" href="css/main.css" type="text/css" media="screen, projection, tv" />
            <link rel="stylesheet" href="css/responsive.css" type="text/css" media="print" />
            <title>Cadastro de Disciplina</title>
        </head>
        <body>
        <%@include file="../Paginas/cabecalho.jsp" %>
        <!-- main content section -->
        <div class="main">
            <!-- left column -->
            <div class="left">

                <!-- block element -->
                <div class="block">
                    <h3 class="head">Header</h3>
                    <div>
                        <table>
                            <tr>
                                <th>Disciplina</th>
                            </tr>
                            <%
                                for (Disciplina disciplina : (ArrayList<Disciplina>) disciplinas) {
                            %>
                            <tr>
                                <td><%= disciplina.getNomeDisciplina()%></td>
                                <td><%= disciplina.getCargaHoraria()%></td>
                                <td><a href="GerenciarDisciplina?acao=RemoverDisciplina&idDisciplina=<%= disciplina.getIdDisciplina()%>">Excluir</a></td>
                                <td><a href="Adm/EditaDisciplina.jsp?acao=EditarDisciplina&nomeDisciplina=<%= disciplina.getNomeDisciplina()%>&idDisciplina=<%= disciplina.getIdDisciplina()%>&cargaHoraria=<%= disciplina.getCargaHoraria()%>">Editar</a></td>
                            </tr>
                            <% }%>
                        </table>

                        <form action="GerenciarDisciplina?acao=InserirDisciplina" method="post">
                            <fieldset title="Cadastro de Disciplina">
                                <label>Nome:</label>
                                <input type="text" name="nomeDisciplina" />
                                <br />
                                <br />
                                <label>Carga Horária:</label>
                                <input type="text" name="cargaHoraria" />
                                <br />
                                <br />
                                <label>Curso:</label>
                                <select name="selectDisciplina">
                                    <%
                                        for (Curso curso : (ArrayList<Curso>) cursos) {

                                    %>
                                    <option value="<%= curso.getId()%>" ><%= curso.getNome()%></option>
                                    <% }%>
                                </select>
                                <br />
                                <br />
                                <input type="submit" name="btnCadastrar" value="Cadastrar" />
                            </fieldset>
                        </form>
                    </div>
                    <h3 class="foot">Footer</h3>
                </div>

                <div class="block">
                    <h3 class="head head_a">Header A</h3>
                    <div>Some extra content</div>
                    <h3 class="foot foot_a">Footer A</h3>
                </div>

                <div class="block block_a">
                    <h3 class="head">Header</h3>
                    <div>Block A: Some extra content</div>
                    <h3 class="foot">Footer</h3>
                </div>
            </div>
        </div>
        <%@include file="../Paginas/rodape.jsp" %>
    </body>
</html>
